{% extends "base.html" %}

{% block refer %}
{% endblock %}

{% block header %}

<nav class="navbar navbar-default">
  <div class="container-fluid">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
        <span class="sr-only">Menu</span>
        <span class="icon-bar">Home</span>
        <span class="icon-bar">New Product</span>
        <span class="icon-bar">About</span>
      </button>
      <a class="navbar-brand" href="#">Brand</a>
    </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      <ul class="nav navbar-nav">
        <li class="active"><a href="#">Link <span class="sr-only">(current)</span></a></li>
        <li><a href="#">Link</a></li>
        <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Menu <span class="caret"></span></a>
          <ul class="dropdown-menu">
            {% for item in nav-items %}
            <li role="separator" class="divider"></li>
            <li>
              <a href="{{item.url}}">{{item.label}}</a>
            </li>
            <li role="separator" class="divider"></li>
            {% endfor %}
          </ul>
        </li>
      </ul>
      
      <form class="navbar-form navbar-left" role="search">
        <div class="form-group">
          <input type="text" class="form-control" placeholder="Search">
        </div>
        <button type="submit" class="btn btn-default">Submit</button>
      </form>
      <ul class="nav navbar-nav navbar-right">
        <li><a href="#">Link</a></li>
        <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Menu <span class="caret"></span></a>
          <ul class="dropdown-menu">
            {% for item in nav-items %}
            <!-- <li role="separator" class="divider"></li> -->
            <li>
              <a href="{{item.url}}">{{item.label}}</a>
            </li>
            <!-- <li role="separator" class="divider"></li> -->
            {% endfor %}
          </ul>
        </li>
      </ul>
    </div><!-- /.navbar-collapse -->
  </div><!-- /.container-fluid -->
</nav>
<!-- ----------------------------------------------------------------- -->

{% endblock %}

{% block content %}
<div class="container container-xs-10">

  <div class="row">
    <h1>{{title}}</h1>
    <h3>{{sub-title}}</h3>
  </div>

  <div class="row">
    <form action="/new-product" method="post">
      <div class="form-group" >
        <label for="p-image">Image</label>
        <input name="p-image" type="text" value="" id="p-image"/>
        <label for="p-name">Name</label>
        <input name="p-name" type="text" value="" id="p-name"/>
        <!-- <button class="btn btn-default" type="submit">Submit</button> -->
        <input name="submit" type="submit" value="Submit" class="btn btn-default"/>
      </div>
    </form>
  </div>
  
  <div class="row">
    <div class="col-xs-6">
      <table class="table table-bordered">
        <thead>
          <tr>
            {% for item in product-list-header %}
            <th>{{item}}</th>
            {% endfor %}
          </tr>
        </thead>
        <tbody>
          {% for prod in product-list %}
          <tr>
            <td>
              <img alt="{{prod.name}}" style="weight:30px;height:30px" src="{{prod.img}}" onclick="alert('{{prod._id}}')" />
            </td>
            <td>{{prod.name}}</td>
            <td>{{prod.count}}</td>
            <td>{{prod.size}}</td>
            <td>{{prod.label}}</td>
            <td>{{prod.color}}</td>
            <td>
              <button class="btn-block" onclick="alert('{{prod._id}}')">detail</button>
            </td>
          </tr>
          {% endfor %}
        </tbody>
      </table>
    </div>

  </div>
</div>


{% endblock %}

{% block footer %}
{% endblock %}

{% block script %}

<script>
  <!-- $(document).ready(function(){ -->
  <!-- $("table").DataTable({ -->
  <!-- paging:false, -->
  <!-- scrolly:400 -->
  <!-- }); -->
  <!-- }); -->
</script>

{% endblock %}
